package com.wedimob.slideshare.bo;

import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import com.wedimob.slideshare.Factory;

public class SharedDocument extends AbstractBO<SharedDocument> {

    private Integer nbViews;
    private Summary summary;
    private Media media = new Media();
    private Summaries associated = new Summaries();
    private Summaries sameauthor = new Summaries();

    public SharedDocument(Summary summary) {
        super();
        this.summary = summary;
    }

    public Integer getNbViews() {
        return nbViews;
    }

    public void setNbViews(Integer nbViews) {
        this.nbViews = nbViews;
    }

    public Summary getSummary() {
        return summary;
    }

    public void addMedium(Medium medium) {
        media.add(medium);
    }

    public Media getMedia() {
        return media;
    }

    public void addAssociated(Summary summary) {
        associated.add(summary);
    }

    public Summaries getAssociated() {
        return associated;
    }

    public void addSameAuthor(Summary summary) {
        sameauthor.add(summary);
    }

    public Summaries getSameauthor() {
        return sameauthor;
    }

    public static void main(String[] args) throws IOException {
        Document doc = Jsoup.connect("http://fr.slideshare.net/syukran.org/8-need-to-know-facts-about-the-quran").get();
        SharedDocument sdoc = Factory.fromDocument(doc, SharedDocument.class, null);
        System.out.println(sdoc);
    }
}
